package cn.com.bsoft.mobile


import cn.com.bsoft.mobile.service.*
import cn.net.xyan.blossom.kotlin.AllOpen
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean
import org.springframework.boot.autoconfigure.domain.EntityScan
import org.springframework.context.annotation.Bean
import org.springframework.context.annotation.ComponentScan
import org.springframework.context.annotation.Configuration
import org.springframework.data.jpa.repository.config.EnableJpaRepositories

@Configuration
@ComponentScan
@EntityScan
@EnableJpaRepositories(basePackages = arrayOf("cn.com.bsoft.mobile.dao"))
@AllOpen
class MobileAppConfiguration{

    @Bean
    @ConditionalOnMissingBean
    fun mobileDeviceService():MobileDeviceService{
        return DefaultMobileDeviceService()
    }

    @Bean
    @ConditionalOnMissingBean
    fun mobileAppService(): MobileAppService {
        return DefaultMobileAppService()
    }

    @Bean
    @ConditionalOnMissingBean
    fun mobileAppVersionService():AppVersionService{
        return DefaultAppVersionService()
    }

    @Bean
    @ConditionalOnMissingBean
    fun appMessageService():AppMessageService{
        return DefaultAppMessageService()
    }

    @Bean
    @ConditionalOnMissingBean
    fun apnsService():AppleApnsService{
        return AppleApnsService()
    }

    @Bean
    @ConditionalOnMissingBean
    fun jpushService():JPushService{
        return JPushService()
    }

    @Bean
    @ConditionalOnMissingBean
    fun feedbackService():FeedbackService{
        return DefaultFeedbackServiceImpl()
    }
}